<!DOCTYPE html>
<html lang="en" class="body-full-height">

        <!-- META SECTION -->
        <title>登陆 - 后台管理系统</title> 
        <link rel="shortcut icon" href="../assets/images/gt_header.png">           
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        
        <link rel="icon" href="favicon.ico" type="image/x-icon" />
        <!-- END META SECTION -->
        
        <!-- CSS INCLUDE -->
        <script src="js/plugins/jquery/jquery.min.js"></script>
        <link rel="stylesheet" type="text/css" id="theme" href="css/theme-default.css"/>
        <!-- EOF CSS INCLUDE -->                                    
    </head>
    <body>
        
        <div class="login-container">
            <div class="login-box animated fadeInDown">
                <div class="login-logo"></div>
                <div class="login-body">
                    <div class="login-title"><strong>登陆</strong>您的账户</div><span id="worringMsg"  style="font-size: smaller;color: #FF9B22;margin-left:35px;float: right"></span>
                    <form class="form-horizontal">
                    <div class="form-group">
                        <div class="col-md-12">
                            <input type="text" class="form-control" id="admin_name" onkeyup="checkInputInfo()" placeholder="账号"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-12">
                            <input type="password" class="form-control" id="admin_pwd" onkeyup="checkInputInfo()" placeholder="密码"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-8">
                            <input type="password" class="form-control" id="security_code" onkeyup="checkInputInfo()" placeholder="验证码"/>
                        </div>
                        <div class="col-md-4">
                            <input type="password" class="form-control" placeholder="1234"/>
                        </div>
                    </div>
                    <div class="form-group" style="margin-top: 20px; margin-bottom: -10px;">
                        <div class="col-md-6"></div>
                        <div class="col-md-6">
                           <input type="button" id="login_btn" class="btn btn-info btn-block" value="登陆" onclick="login()" disabled="true" style="font-size: 16px">
                        </div>
                    </div>
                    </form>

                    <script type="text/javascript">
                        function login() {
                            var admin_name=document.getElementById("admin_name").value;
                            var admin_pwd=document.getElementById("admin_pwd").value;
                            var security_code=document.getElementById("security_code").value;
                            if(admin_name!=""&&admin_pwd!=""&&security_code!=""){
                                $.post('/adminLogin',{adminName:admin_name,adminPwd:admin_pwd},
                                function (resultMsg) {
                                    if(resultMsg!=""){
                                        if(resultMsg=="该用户名不存在"||resultMsg=="密码错误") {
                                            document.getElementById("login_btn").disabled=true;
                                            document.getElementById("worringMsg").innerHTML = resultMsg;
                                            document.getElementById("admin_pwd").value = "";
                                        }
                                    }else {
                                        window.location.href = 'fiUserMng.html',true;
                                        console.log(window.location.href);
                                    }
                                }
                                );
                            }else{
                                document.getElementById("worringMsg").innerHTML="请输入正确的用户名和密码";
                            }
                        }
                        function checkInputInfo() {
                            var admin_name=document.getElementById("admin_name").value;
                            var admin_pwd=document.getElementById("admin_pwd").value;
                            var security_code=document.getElementById("security_code").value;
                            var worringMsg=document.getElementById("worringMsg").value;
                            if(admin_name!=""&&admin_pwd!=""&security_code!=""){
                                document.getElementById("login_btn").disabled=false;
                            }
                        }
                    </script>

                </div>
                <div class="login-footer">
                    <div class="pull-left" style="margin-left: 10px;margin-top: 5px;">
                        &copy; 2016 互联网金融司法诉讼平台
                    </div>
                </div>
            </div>
            
        </div>
        
    </body>
</html>